<template>
  <div class="abc">
    <h1>济南天气预报</h1>
    <p>星期：{{ weather.data.forecast[0].week }}</p>
    <p>低温：{{ weather.data.forecast[0].low }}</p>
    <p>高温：{{ weather.data.forecast[0].high }}</p>
    <p>日出：{{ weather.data.forecast[0].sunrise }}</p>
    <p>日落：{{ weather.data.forecast[0].sunset }}</p>
    <p>天气：{{ weather.data.forecast[0].type }}</p>
    <p>风级：{{ weather.data.forecast[0].fl }}</p>
    <p>明天天气预测：{{ weather.data.forecast[1].type }}</p>
    </div>
</template>
<script>
import axios from "axios";
export default {
  name: "MyForecast",
  data() {
    return {
      weather: {}
    }
  },
  created() {
    axios
      .get("http://localhost/ajax.php?select=another")
      .then((response) => {
        this.weather = response.data;
      })
      .catch((error) => {
        console.error("There was an error!", error);
      });
  },
};
</script>
<style>
  body {
    margin: 0;
  }
</style>